<script setup>
import { storeToRefs } from "pinia";
import { onLoad } from "@dcloudio/uni-app";
import useUserStore from "@/pinia/modules/userStore";
const userStore = useUserStore();
const { truckInfo } = storeToRefs(userStore);
onLoad(() => {
  userStore.fetchTruckInfo();
});
</script>

<template>
  <view class="page-container">
    <swiper class="truck-pictures" indicator-active-color="#fff" circular indicator-dots>
      <swiper-item v-for="(item,index) in truckInfo.pictureList" :key="index">
        <image class="picture" mode="aspectFill" :src="item.url"></image>
      </swiper-item>
    </swiper>
    <view class="truck-meta">
      <uni-list :border="false">
        <uni-list-item :border="false" title="车辆编号" :rightText="truckInfo.id" />
        <uni-list-item :border="false" title="车辆号牌" :rightText="truckInfo.licensePlate" />
        <uni-list-item :border="false" title="车型" :rightText="truckInfo.truckType" />
        <uni-list-item :border="false" title="所属机构" :rightText="truckInfo.currentOrganName" />
        <uni-list-item :border="false" title="载重" :rightText="truckInfo.allowableLoad" />
      </uni-list>
    </view>
  </view>
</template>

<style lang="scss" scoped>
@import './index.scss';
</style>
